<%= javascript_include_tag "facebooker","append" %>
<%= stylesheet_link_tag "base","rails","form","lister","box","tabs" %>
<style type="text/css">
ul {
  padding:0px;
  margin:0px;
}

.background-top
{
  background: transparent url(<%= facebook_image_url 'TopBG.png' %>) no-repeat;
  padding-top:10px;
}

.clearfix /* tabs background color */
{
    /*background-color:#f0f0f0;*/
}

.background-mid
{
    background-color:#f0f0f0;
}

.background-bottom
{
  background: transparent url(<%= facebook_image_url 'BottomBG.png' %>) no-repeat;
}

.background-bottom A:hover {color:#ffffff;}
.background-bottom A {color:#cccccc;}

.prizes {}
.prize {
  width:47.5%;
  float:left;
  height:150px;
  margin:4px;
  overflow:hidden;
  border:1px solid #D8DFEA;
  background:#f8f8f8;
}

.prize-pic {
  float:left;
  width:53%;
  padding-left:10px;
}

.prize-desc,.prize-description {
  float:left;
  padding-top:55px;
  width:40%;
  text-align:center;
}

.prize-hover {
  background-color:#ffa;
}

.prize-selected {
  background-color:#e0ffa2;
}

.change-prize {
  padding:10px 0 10px 10px;
}

.header img {
  width:200px;
  height:65px;
  margin:0px auto;
}

.home-layout{
  text-align:left;
  width:96.3%;
  padding:10px 10px 5px;
  margin:4px 0 4px 8px;
}

.current-streak {
  background-color:#4D9FBD;
  text-align:center;
  padding:32px;
  padding-bottom:0px;
  margin:0px 8px 8px 0;
}

.current-streak-num {
  font-size:21px;
  font-weight:bold;
  padding:2px;
  margin:0px;
  vertical-align:middle;
}

.current-streak .change-prize {
  text-align:right;
}

.last-streak {
  text-align:center;
  margin:0px 8px 8px 0;
  background:#BD4D67;
  font-style:italic;
  height:45px;
}

.challenge-notification {
  background:#ccc;
  margin:0px 8px 8px 0;
  padding:10px;
}

.place-bets {
  display:block;
  padding:13px 0 0;
  color:white;
  font-weight:bold;
  margin:0;
  text-align:center;
  height: 32px;
  border: 2px solid #226F14;
  background: transparent url(<%= facebook_image_url "green_header.gif" %>) repeat-x scroll 0% 0%;  
}

.place-challenge-bets {
  color:white;
  font-weight:bold;
  text-align:center;
  border: 2px solid #226F14;
  height:30px;
  background: transparent url(<%= facebook_image_url "green_header.gif" %>) repeat-x scroll 0% 0%;  
}

.reset-bets {
  display:block;
  padding:5px 0 0 0;
  margin:7px 0px 20px 0;
  text-align:center;
  color:white;
  height: 19px;
  border: 2px solid #FF8F35;
}

.buy-wins {
  display:block;
  padding:5px 0 0 0;
  margin:4px;
  text-align:center;
  color:white;
  height: 19px;
  border: 2px solid #FF8F35;
}

.team-hover {
  background-color:#C6C6C6;
}

.team-selected {
  background-color:#ffa;
}

.bet-selected {
  background-color:#E0FFA2;  
}

.leagues {
  border:1px dotted #D8DFEA;
  margin-right: 5px;
}

table.lister table.no-lister td {
  border:0px;
  padding:0px;
  margin:0px;
}

.filter {
  margin:5px 0 0 0;
  border:1px dotted #D8DFEA;
  background: #FFF;
  width:100%;
}

.filter li {
  padding: 4px;
}

.filter td {
  padding: 4px;
}

table.lister thead tr th,
table.lister thead tr th {
  background: transparent url(<%= facebook_image_url "apple_header.gif" %>) repeat-x scroll 0% 0%;
}

.lister thead td {
  background: transparent url(<%= facebook_image_url "apple_header_2.gif" %>) repeat-x scroll 0% 0%;
  color:#4D4D4D;
  font-size:10px;
}

.filter .selected,
.tab td span a,
.tab li span a {
  background: transparent url(<%= facebook_image_url "button-selected.gif" %>) repeat-x scroll 0% 0%;
}

.filter li.selected a,
.filter td.selected a {
  color:#fff;
  font-weight:bold;
  padding: 2px;
}

.key {
  border:1px dotted #D8DFEA;
  padding:5px;
  margin:0px;
  background:#e6e6e6;
}

.key td {
  padding: 5px;
  font-size: 10px;
}

span.bet-spread {  font-size:14px;}

.winstreak-goal {
  padding:30px 35px;
  background: transparent url(<%= facebook_image_url "winner.png" %>) no-repeat scroll 0% 0%;
}

.boldfont {  font-weight:bold;}

.center {
  text-align: center;
}

.boardkit_frame {  
  width: 744px;
  border: 1px solid #D8DFEA;
}

.boardkit_title {
  background: transparent url(<%= facebook_image_url 'apple_header.gif' %>) repeat-x scroll 0% 0%;
  font-weight: bold;
  color: #4D4D4D;
  padding: 5px;
  font-size: 12px;
  border: none;
}

.boardkit_topic {   background: #fff; border:none; }

.boardkit_subtitle {   background: transparent url(<%= facebook_image_url 'apple_header_2.gif' %>) repeat-x scroll 0% 0%; }

.tabs {
  border:none;
  height:37px;
  background: transparent url(<%= facebook_image_url 'menu-extend.png' %>) repeat-x scroll 0% 0%; 
}

.left_tabs {
  float: left;
  padding: 0px;
}


.toggle_tabs li{
  line-height:29px;
 }


.toggle_tabs li a.selected {
  background: transparent url(<%= facebook_image_url 'button-selected.gif' %>) repeat-x scroll 0% 0%;
  border: 1px solid #141414;
} 

.toggle_tabs li a {
    background: transparent url(<%= facebook_image_url 'button-normal.gif' %>) repeat-x scroll 0% 0%;
	height: 30px;
	padding:2px 15px 3px 15px;
}

.toggle_tabs li a:hover {
  background: transparent url(<%= facebook_image_url 'button-hover.gif' %>) repeat-x scroll 0% 0%;
  color:white;
  text-decoration: none;
}
 
</style>

<%if not current_user.hide_bookmark%>
<div class="home-layout" style="background:#e6e6e6;width:95%;padding-bottom:5px;padding-top:5px;margin-top:0px" id='bookmark1'>
<span style="float:right;padding:10px">
  <%=link_to "Done!","#",:onclick=>"dismiss_ajax('bookmark1'," + current_user.id.to_s + ");return false;",:clicktohide=>"bookmark1"%>
</span>
<TABLE><TR>
<TD><%=image_tag"bookmark.png"%></TD>
<TD><span style="padding:5px;">Bookmark 13wins <span style="font-weight:bold;">below</span> for easy access!</span></TD>
</TR></TABLE>
</div>
<%end%>
<p></p>
<div class="background-top">
<div class="header">

<table width="100%">
  <tr>
    <td><center>
	<!-- Place following iframe where you would like the ad to appear -->
	<fb:iframe frameborder='0' scrolling='no' marginheight='0' marginwidth='0' width='645' height='75' src='http://adparlor.com/serveIFrameAd.aspx?appId=5307783&adtype=6&adTBG=EEEEEE&adTColor=0000000&adCntColor=000000&adBG=EEEEEE' id='AdParlorAd'></fb:iframe>
  </center></td>
 </tr>
</table>

<table width="100%">
  <tr>
    <td width="30%">
      <fb:user-agent includes="ie 6"><%= link_to(image_tag('logo.jpg'),root_path) %></fb:user-agent> 
      <fb:user-agent excludes="ie 6"><%= link_to(image_tag('logo.png'),root_path) %></fb:user-agent> 
    </td>
    <td width="70%">
      <%= render :partial=>"winstreaks/stat",:locals=>{:user=>current_user} %>
    </td>
  </tr>
</table>
</div>
</div>


<% unless params[:controller] =~ /^admin\// %>
<% fb_tabs do %>
<%= fb_tab_item2 lambda{params[:controller] == "bets" && params[:type] == nil},'Current Bets[' + current_user.current_streak_bets.size.to_s + ']',bets_path %>
<%= fb_tab_item2 :buy_wins,'Shop',buy_wins_path %>
<% Sport.all(:order=>"position asc").each do |sport| %>
<%= fb_tab_item2 lambda{params[:controller] == "sports" && params[:id] == sport.id.to_s },sport.name,sport_path(sport) %>
<% end %>
<%= fb_tab_item2 :users,'Leaderboards',users_path %>
<%= fb_tab_item2 ['winstreaks','history'],'History',history_winstreaks_path %>
<%= fb_tab_item2 :forum,'Forum',"http://apps.facebook.com/thirteenwins/forum" %>
<%= fb_tab_item2 :help,'Help',"http://apps.facebook.com/thirteenwins/help" %>
<% end %>


<% else %>

<% fb_tabs do %>
<%= fb_tab_item2 false,'admin',admin_matches_path if current_user.admin?%>
<%= fb_tab_item2 :admin_matches,"Matches",admin_matches_path %>
<%= fb_tab_item2 :admin_bets,"Bets",admin_bets_path %>
<%= fb_tab_item2 :admin_teams,"Teams",admin_teams_path %>
<%= fb_tab_item2 :admin_users,"Users",admin_users_path %>
<%= fb_tab_item2 :admin_sports,"Sports",admin_sports_path %>
<%= fb_tab_item2 :admin_prizes,"Prizes",admin_prizes_path %>
<%= fb_tab_item2 :admin_countries,"Countries",admin_countries_path %>
<%= fb_tab_item2 :admin_leagues,"Leagues",admin_leagues_path %>
<%= fb_tab_item2 :admin_point_configs,"WinPoints",admin_point_configs_path %>
<%= fb_tab_item2 false,'Return to App',bets_path %>
<% end %>

<% end %>



